package com.office.app.bussiness.action;

import com.office.app.system.model.Org;
import com.office.framework.common.BaseController;

/**
 * Created by jyyco on 2015/7/25.
 */
//所有Controller 需要继承BaseController 方便使用拦截器和其他的一些公共处理
public class MobileOrgController extends BaseController {
    //默认路由方法 跳转list 页面
    public void index(){
        keepPara();
        setAttr("page", Org.dao.paginate(getParaToInt("start", 1),getParaToInt("limit", 5), getPara("name")));
        //跳转页面路径，配合Config里面的路由配置，可以跳转到security/org/list.html
        render("organization/list.html");
    }

    public void edit(){
        if(getParaToInt()!=null) {
            setAttr("org", Org.dao.get(getParaToInt()));
        }
        render("organization/edit.html");
    }

    public void lookup(){
        keepPara();
        setAttr("page",Org.dao.getByParent(getParaToInt(0)));
        render("organization/org_tree.html");
    }
}
